let b: unknown;
b = 10;
b = "10";
b = "dd";
let xx: string;

// xx = b; //不能将类型“unknown”分配给类型“string”。ts(2322)
// xx = b as string;
xx = <string>b;

let str: unknown;
str = "abc";
// str.toUpperCase(); //报错，不能调用类型“unknown”的属性“toUpperCase”。
(<string>str).toUpperCase(); // 类型断言 就不会报错
(str as string).toUpperCase(); // 类型断言 就不会报错
